﻿using System;
using System.Collections.Generic;
using NHibernate;
using NHibernate.Criterion;
using BrokerBase.Lib.Query;
namespace BrokerBase.Lib.Core
{
    public interface IBaseService<T>
    {
        ISession HbmSession { get; set; }

        void SaveOrUpdate(T obj);

        void Delete(T obj);

        T GetById(int id);

        T GetByHQL(string hql);

        IList<T> GetListByHQL(string hql);

        IList<T> GetListByHQLWithPaging(string hql, string totalHql, int begin, int max, out long total);

        IList<T> GetListByHQLWithPaging(PagingQuery pq, out long total);

        IQuery GetListByHQLWithPaging2(string hql, string totalHql, int begin, int max, out long total);



        IList<T> GetListByCreateCriteria(ICriteria criteria, IList<Order> orders, int begin, int max, out long total);
    }
}
